@extends('desktop.template.bootstrap')
@section('title', '阅读记录 - 007书房')
@section('keywords', '阅读记录,007书房')

@section('scripts')
<link rel="stylesheet" href="{{asset('css/public-search.css')}}" />
@endsection

@section('header')
@include('desktop.template.navbar-simple')
@endsection

@section('content')
<section class="banner">
	<div class="container">
		<ol class="breadcrumb">
			<li><a href="#">首页</a></li>
			<li class="active">阅读记录</li>
		</ol>
	</div>
</section>

<section class="search">
	<div class="container">
		<div class="row">
			<div class="col-xs-9">
				<div class="books">
					@foreach($books as $book)
					<div class="book">
						<div class="media">
							<div class="media-left">
								<a href="{{ url('books/'.$book['book']->id) }}"><img height="100%" src="{{ $book['book']->thumbnailUrl() }}" alt="" /></a>
							</div>
							<div class="media-body">
								<h3 class="title"><a href="{{ url('books/'.$book['book']->id) }}">{{ $book['book']->name }}</a></h3>
								<div class="author">
									<span class="fa fa-fw fa-user-circle-o"></span>
									{{ $book['book']->author }} &nbsp;|&nbsp;
									{{ mb_substr($book['book']->category->name, 0, 2) }} &nbsp;|&nbsp;
								</div>
								<div class="desc">
									{!! $book['book']->abstract !!}
								</div>
								<div class="row">
									<div class="col-xs-8">
										<div class="info">
											继续阅读：
											<a href="{{ url('/books/'.$book['book']->order.'/sections/'.$book['section']->order) }}">{{ $book['section']->name }}</a>
										</div>
									</div>
									<div class="col-xs-4 text-right">
										<a href="{{ url('books/'.$book['book']->id) }}" class="btn btn-danger">书籍详情</a>
									</div>
								</div>
							</div>
						</div>
					</div>
					@endforeach
				</div>
			</div>
			<div class="col-xs-3">
				<div class="recommend">
					<h4 class="title">
						猜你喜欢
					</h4>
					<ul class="list-unstyled books-sm">
						@foreach($hotBooks as $hotBook)
						<li>
							<a class="book-sm" href="{{ url('/books/'.$hotBook->order) }}">
								<div class="media">
									<div class="media-left">
										<img height="100%" src="{{ $hotBook->thumbnailUrl() }}" alt="" />
									</div>
									<div class="media-body">
										<h4 class="title dotdotdot-nowrap">{{ $hotBook->name }}</h4>
										<div class="author">
											<span class="fa fa-fw fa-user-circle-o"></span>
											{{ $hotBook->author }}
										</div>
										<div class="abstract">
											{!! str_limit(str_replace("&nbsp;","",strip_tags($hotBook->abstract)), 70) !!}
										</div>
										<div class="info"><span class="label label-default">{{ $hotBook->likes }}人喜欢</span></div>
									</div>
								</div>
							</a>
						</li>
						@endforeach
					</ul>
				</div>
			</div>
		</div>
	</div>
</section>

@endsection